<? session_start();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?=$title;?></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="/gmap/template/default.css" rel="stylesheet" type="text/css" />
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA1QnAxBtPWpvkkIJ1M7uNRhRg8ea_49lyqtDTy_ytR6v-HqmzORRUZuFz8QQsoPvQ-uEZSLs4m1nYsw" type="text/javascript"></script>

<script src="/gmap/src/prototype.js" type="text/javascript"></script>
<script src="/gmap/src/norightclick.js" type="text/javascript"></script>

<script type="text/javascript">
 //<![CDATA[
	function Buildmap() {	

		if (GBrowserIsCompatible()) 
			{
				// create map and add controls
				var map = new GMap2($("map"));
				map.addControl(new GLargeMapControl());        
				map.addControl(new GMapTypeControl());
				
				// set centre point of map
				var centerPoint = new GLatLng('13.762728', '100.465164');
				map.setCenter(centerPoint, 11);	
				
				// add a draggable marker
				var marker = new GMarker(centerPoint, {draggable: true});
				map.addOverlay(marker);
				
				// add a drag listener to the map
				GEvent.addListener(marker, "dragend", function() {
					var point = marker.getPoint();
					map.panTo(point);
					var urlLat = point.lat();
					var urlLng = point.lng();
					$("input").value = "<IFRAME src=http://localhost/gmap/v1/map/?lat="+urlLat+"&lng="+urlLng+" width=420 height=360 frameborder=0 scrolling=no></IFRAME>";
				});
			}

	}
/*	
	function SelectAll(id)
{
    $(id).focus();
    $(id).select();
}
*/
    //]]>	
    </script>
<style type="text/css">
#map {
    height: 460px;
	width: 680px;
	border: 1px solid gray;
	margin-top: 8px;
	margin-left: 8px;
	overflow: hidden;
	
}
#input {
	
	margin-bottom: .5em;
	padding: 2px 5px;
	border: 1px solid #CCCCCC;
	font: normal small Arial, Helvetica, sans-serif;
	color: #999999;
}
</style>
</head>
<body onLoad="Buildmap()" onUnload="GUnload()">

<!-- header begin -->
<?php include('include/header.php');?>

<!-- menu begin -->
<?php include('include/menu.php');?>

<!-- content begin -->
<div id="content">
	<div id="main">
		<div  id="login" class="boxed"  style=" height: 590px; width: 700px;">
        <h2 class="title">เลือกตำแหน่งที่ <?=$sessuser;?> อยู่</h2>
		&nbsp; Tips:ใช้เมาส์คลิ๊กหมุดเพื่อลากไปยังตำแหน่งที่ต้องการ แล้วคลิ๊กปุ่ม "ตกลง" ด้านล่างขวามือ  
		<div id="map" ></div>
        <?php echo form_open('gmap/v1/do_getmap');?>
       <input size="80" type="hidden" name="link" id="input" value="" />
       <input id="mapsubmit" type="submit"  value="  ตกลง ฉันเอาตำแหน่งนี้  " />
       </form>
<br />
  </div>
	</div>
    </div>
<!-- footer begin -->
<?php include('include/footer.php'); ?>
</body>
</html>
